package com.frame.server.user.feign.fallback;

import com.frame.common.tools.result.ResultCode;
import com.frame.common.tools.result.ServiceResult;
import com.frame.server.user.feign.OrderService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @auther zhangwj
 * @date 2021/4/7 下午6:34
 */
@Component
public class OrderServiceFallbackFactory implements FallbackFactory<OrderService> {

    @Override
    public OrderService create(Throwable throwable) {
        return () -> ServiceResult.getFailureResult(ResultCode.SERVICE_FALL_BACK);
    }
}
